<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title>Exam</title>
</head>

<body>

<div id="wrap">
    <h1>{{ exam.remarks  }}</h1>

    {% for key,value in questions.items %}
        <h2>{{ key }}</h2>
        {% for q,v in value.items %}
            <h3
                {% if v.exam and v.user %}
                    style="color:green;"
                {%  else %}
                    {% if v.exam and not v.user %}
                        style="color:blue;"
                    {% else %}
                        {% if v.user %}
                            style="color:red;"
                        {% endif %}
                    {% endif %}
                {% endif %}>
                {{ q }}
            </h3>
        {% endfor %}
    {% endfor %}
    <p>You answered {{ correct_answers }} out of {{ question_count }} questions correct</p>
    <p>Your score : {{ grade }}</p>
    <a href="/exams/user/{{ user }}/stats/{{ exam.id }}">See statistics</a>
</div>

</body>
</html>